package javagprssrv.DataBase;

public class DataProvider
{
    public java.lang.String DBServerIP;
    public java.lang.String DBName;
    public java.lang.String DBUser;
    public java.lang.String DBPass;
    public java.lang.String DBServerPort;
    public int ConnectionType;
    private java.lang.String DataConnectionClass_Java;
    private java.lang.String DataConnectionClass_Jdbc_Odbc;
    private java.lang.String ODBC_DB_Name;
    
    public java.lang.String getConnectClassString() {
        java.lang.String s = "";
        if (this.ConnectionType == 0) {
            s = this.DataConnectionClass_Java;
        }
        if (this.ConnectionType == 1) {
            s = this.DataConnectionClass_Jdbc_Odbc;
        }
        return s;
    }
    
    public java.lang.String getConnectURL() {
        java.lang.String s = "";
        if (this.ConnectionType == 0) {
            s = "jdbc:microsoft:sqlserver://" + this.DBServerIP + ":" + this.DBServerPort + ";DatabaseName=" + this.DBName;
        }
        if (this.ConnectionType == 1) {
            s = "jdbc:odbc:" + this.ODBC_DB_Name;
        }
        return s;
    }
    
    public DataProvider() {
        this.DBServerIP = "";
        this.DBName = "";
        this.DBUser = "";
        this.DBPass = "";
        this.DBServerPort = "";
        this.ConnectionType = 0;
        this.DataConnectionClass_Java = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
        this.DataConnectionClass_Jdbc_Odbc = "sun.jdbc.odbc.JdbcOdbcDriver";
        this.ODBC_DB_Name = "TLF";
    }
}
